set(TARGET_NAME IonexTest)

find_package(pegtl CONFIG REQUIRED)

include_directories("../")

file(GLOB HEADERS "*.h")
file(GLOB SOURCES "*.cpp")
file(GLOB PRIVATES "Private/*.h" "Private/*.cpp")

file(GLOB TEST_FILES "TestFiles/*.*i")
string(JOIN "|" TESTS ${TEST_FILES})
add_compile_definitions(-DTESTS="${TESTS}")

source_group("Headers" FILES ${HEADERS})
source_group("Sources" FILES ${SOURCES})
source_group("Private" FILES ${PRIVATES})
source_group("TestFiles" FILES ${TEST_FILES})

add_executable(${TARGET_NAME} ${HEADERS} ${SOURCES} ${PRIVATES} ${TEST_FILES})

target_link_libraries(${TARGET_NAME} PUBLIC IonexFileReader)

set_target_properties(${TARGET_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}")
install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE})